package com.liuyjy.utils.utils;

import com.google.common.base.CaseFormat;

/**
 * @Author liuyjy
 * @Date 2025/2/13 10:06
 * @Description: Bean工具类
 * https://www.cnblogs.com/jelly12345/p/17799614.html
 **/
public class BeanUtils {

    /**
     * 把一个策略名称转换成beanName
     * <pre>
     *     如 WEN_CHANG ，ChainService -> wenChangChainService
     * </pre>
     *
     * @param strategyName 标识
     * @param serviceName 服务名称
     * @return beanName
     */
    public static String getBeanName(String strategyName, String serviceName) {
        //将服务转换成小写字母开头的驼峰形式，如A_BCD 转成 aBcd
        return CaseFormat.UPPER_UNDERSCORE.converterTo(CaseFormat.LOWER_CAMEL).convert(strategyName) + serviceName;
    }
}
